<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta name="format-detection" content="telephone=no">
    <meta name="viewport" content="initial-scale=1,user-scalable=no,maximum-scale=1,width=device-width">
    <title>短信催收</title>
    <link href="../Content/css/style.css" rel="stylesheet">
    <script src="../Content/js/rem.js"></script>
    <style>
        .xybtn{
            margin: 10px;
            color: #cbcbcb;
        }
        .layermchild.layermanim .layermcont {
            line-height: 26px;
        }
    </style>
</head>
<body>
<!--<div id="loading">-->
    <!--<img src="../Content/imgs/kbloading.gif" >-->
<!--</div>-->
    <div class="wrap">
        <div class="hybox">
            <p class="hy-wz"><i id="name" style="font-style: normal;"></i>向您借款 <span id="data">2017-08-07</span></p>
            <ul class="hylibox">
                <li>借款金额:<span id="dkje">10000</span></li>
                <li>借款时长:<span id="datatime"></span>天</li>
                <li>年化利率:<span id="nhlv"></span>%</li>
                <li style="width: 50%">还款方式:<span id="hkfs"></span></li>
            </ul>
        </div>
        <a class="dxcsbtn" onclick="sumit()">短信催收</a>
    </div>
    <script src="../Content/js/jquery-2.2.4.min.js"></script>
    <script src="../Content/js/layer-mobl.js"></script>
<script>
    //message/getBorrowMessage
    var urs=window.location.search;
    var strs=urs.substring(1);
    var silp=strs.split('&');
    var res={};
    for (var i=0;i<silp.length;i++){
        res[silp[i].split("=")[0]]=silp[i].split("=")[1];
    }
    console.log(res);
    var winH=$(window).height();
    $(".wrap").css("height",winH);
    $.ajax({
        type : "GET",
        url : localStorage.url+"/message/getBorrowMessage",
        dataType : 'json',
        async: false,
        contentType : "application/json",
        data :{
            id:res.id
        },
        success : function(datas) {
            console.log(datas);
            $("#name").html(datas.name);
            $("#datatime").html(datas.loan_time);
            $("#jkje").html(datas.loan_money);
            $("#nhlv").html(datas.rate*100);
            $("#hkfs").html(datas.way);

        },
        error : function(err) {
            //console.log(err);
        }
    });


    function sumit() {
        $.ajax({
            type : "GET",
            url : localStorage.url+"/deal/duanXinCui",
            dataType : 'json',
            async: false,
            contentType : "application/json",
            data :{
                id:res.id
            },
            success : function(datas) {
                console.log(datas);
                if(datas.data=="1"){
                    layer.open({
                        content:"短信已发送",
                        time:10
                    });
                    setTimeout(function () {
                        history.back(-1)
                    },1000)
                }
                $("#loading").hide();


            },
            error : function(err) {
                //console.log(err);
            }
        });
    }
function goback() {
    window.history.back(-1)
}
</script>
</body>
</html>
